import * as Actions from './action'

const initState={
    location:"上海",
    wether:{
        code:0,
        text:"晴"
    }
}

export default function HomeReducer(state=initState,action){
    switch(action.type){
        case Actions.FETCH_DATA:
            return Object.assign({},state,{
                location:action.data.location.name,
                wether:action.data.now,
                time:action.data.last_update
            });
        default :
            return state
    }
}